﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XNADota.Graphics
{
    public class PaletteReference
    {
        private PaletteRenderer _Palette;

        public PaletteRenderer PaletteRenderer
        {
            get { return _Palette; }
        }

        public PaletteReference(PaletteRenderer palette)
        {
            this.Attach(palette);
        }

        public void Attach(PaletteRenderer palette)
        {
            this._Palette = palette;
            if (!palette.ReferenceSet.Contains(this))
                palette.ReferenceSet.Add(this);
        }

        public void Detach()
        {
            this._Palette = null;
        }
    }
}
